using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._Workflow._Tasks
{
    /// <summary>
    /// <para>Set Task Status</para>
    /// <para>Updates the status of a task based on the state of the Workflow Manager (Classic) job created for the task.</para>
    /// <para>根据为任务创建的 Workflow Manager （Classic） 作业的状态更新任务的状态。</para>
    /// </summary>    
    [DisplayName("Set Task Status")]
    public class SetTaskStatus : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SetTaskStatus()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_job_id">
        /// <para>Job ID</para>
        /// <para>The job ID of the task job that has a change in status.</para>
        /// <para>状态发生更改的任务作业的作业 ID。</para>
        /// </param>
        /// <param name="_parent_id">
        /// <para>Parent Job ID</para>
        /// <para>The job ID of the task group job that is the parent to the task job.</para>
        /// <para>任务组作业的作业 ID，该作业是任务作业的父级。</para>
        /// </param>
        /// <param name="_status">
        /// <para>Status</para>
        /// <para><xdoc>
        ///   <para>Specifies the status of the selected task.
        ///   <bulletList>
        ///     <bullet_item>Working—Work has begun for the task.  </bullet_item><para/>
        ///     <bullet_item>Complete—Work has been completed for the task.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定所选任务的状态。
        ///   <bulletList>
        ///     <bullet_item>工作 - 任务的工作已开始。</bullet_item><para/>
        ///     <bullet_item>完成 - 任务的工作已完成。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// </param>
        public SetTaskStatus(long? _job_id, long? _parent_id, _status_value? _status)
        {
            this._job_id = _job_id;
            this._parent_id = _parent_id;
            this._status = _status;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Set Task Status";

        public override string CallName => "topographic.SetTaskStatus";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_job_id, _parent_id, _status.GetGPValue(), _database_path, _updated_job_id];

        /// <summary>
        /// <para>Job ID</para>
        /// <para>The job ID of the task job that has a change in status.</para>
        /// <para>状态发生更改的任务作业的作业 ID。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Job ID")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _job_id { get; set; }


        /// <summary>
        /// <para>Parent Job ID</para>
        /// <para>The job ID of the task group job that is the parent to the task job.</para>
        /// <para>任务组作业的作业 ID，该作业是任务作业的父级。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Parent Job ID")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _parent_id { get; set; }


        /// <summary>
        /// <para>Status</para>
        /// <para><xdoc>
        ///   <para>Specifies the status of the selected task.
        ///   <bulletList>
        ///     <bullet_item>Working—Work has begun for the task.  </bullet_item><para/>
        ///     <bullet_item>Complete—Work has been completed for the task.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定所选任务的状态。
        ///   <bulletList>
        ///     <bullet_item>工作 - 任务的工作已开始。</bullet_item><para/>
        ///     <bullet_item>完成 - 任务的工作已完成。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Status")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _status_value? _status { get; set; }

        public enum _status_value
        {
            /// <summary>
            /// <para>WORKING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("WORKING")]
            [GPEnumValue("WORKING")]
            _WORKING,

            /// <summary>
            /// <para>COMPLETE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("COMPLETE")]
            [GPEnumValue("COMPLETE")]
            _COMPLETE,

        }

        /// <summary>
        /// <para>Input Database Path</para>
        /// <para>The Workflow Manager (Classic) database connection file that contains the job information. If no connection file is specified, the current default Workflow Manager (Classic) database will be used.</para>
        /// <para>包含作业信息的 Workflow Manager （Classic） 数据库连接文件。如果未指定连接文件，则将使用当前默认的 Workflow Manager （Classic） 数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Database Path")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _database_path { get; set; } = null;


        /// <summary>
        /// <para>Updated Job ID</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Job ID")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public long _updated_job_id { get; set; }


        public SetTaskStatus SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}